{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "digital-ghost",
   "metadata": {},
   "source": [
    "# Quantifier Instantiation Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "complex-belle",
   "metadata": {},
   "outputs": [],
   "source": [
    ":sccache 1\n",
    ":dep prover-lab = { path = \"../..\" }\n",
    ":dep z3tracer = \"0.8.0\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "forced-mountain",
   "metadata": {},
   "outputs": [],
   "source": [
    "use prover_lab::z3log::*;\n",
    '\n',
    "let model = process_file(\"/tmp/mvp.z3log\")?;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fitted-petroleum",
   "metadata": {},
   "outputs": [],
   "source": [
    "// Compute top instantiated terms and retrieve the \"timestamps\" at which instantiations occur for each of the top terms.\n",
    "let instantiation_times = compute_instantiation_times(&model);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "raising-hydrogen",
   "metadata": {},
   "outputs": [],
   "source": [
    "plot_instantiations(&instantiation_times, \"Top 10 Quantifiers Instantiations\", 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "steady-finding",
   "metadata": {},
   "outputs": [],
   "source": [
    "let user_instantiation_times = instantiation_times.clone().into_iter()\n",
    "                  .filter(|(n, _)| n.starts_with(\"outputbpl\")).collect::<Vec<_>>();\n",
    "plot_instantiations(&user_instantiation_times, \"Top 10 User Quantifiers Instantiations\", 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "beautiful-emerald",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Rust",
   "language": "rust",
   "name": "rust"
  },
  "language_info": {
   "codemirror_mode": "rust",
   "file_extension": ".rs",
   "mimetype": "text/rust",
   "name": "Rust",
   "pygment_lexer": "rust",
   "version": ""
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
